//
//  WBMTLeftCell.m
//  WBMTwaimai
//
//  Created by WangBiao on 16/9/21.
//  Copyright © 2016年 lsrain. All rights reserved.
//

#import "WBMTLeftCell.h"

@implementation WBMTLeftCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setupUI];
    }
    return self;
}

- (void)setLeftModel:(WBMTLeftList *)leftModel{
    _leftModel = leftModel;
    self.textLabel.text = leftModel.name;
}

#pragma make - 搭建界面
- (void)setupUI{
 
    self.textLabel.font = [UIFont systemFontOfSize:13];
    self.textLabel.textColor = [UIColor cz_colorWithHex:464646];
    self.textLabel.numberOfLines = 2;
    
    self.contentView.backgroundColor = [UIColor cz_colorWithHex:0xf8f8f8];
    
    //选中的背景
    UIView *selectedV = [[UIView alloc]init];
    selectedV.backgroundColor = [UIColor cz_colorWithHex:0xffffff];
    self.selectedBackgroundView = selectedV;
    
    //cell前面的竖线
    UIView *verLine = [[UIView alloc]init];
    verLine.backgroundColor = [UIColor cz_colorWithHex:0xffd900];
    [selectedV addSubview:verLine];
    
    [verLine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(4, 28));
        make.left.centerY.mas_equalTo(selectedV);
    }];
    
    //cell的分割线
    //1.设置tableView的cell分割线样式
    //2.重新给cell加一个分割线
    UIView *segL = [[UIView alloc]init];
    segL.backgroundColor = [UIColor cz_colorWithHex:0xf3f3f3];
    [self.contentView addSubview:segL];
    [segL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.left.bottom.equalTo(self.contentView);
        make.height.mas_equalTo(1);
    }];
}

@end
